<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>学员信息管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/statics/css/styles.css" />

  </head>
  
  <body>
  <table class="stuview">
  	<tr>
  		<td colspan="2" style="text-align:right; padding-right: 20px;"><a href="student/add" class="opr-btn">添加学员</a></td>
  	</tr>
  </table>
  
  	<table class="stuview">
  		<tr>
  			<th>学号</th>
  			<th>姓名</th>
  			<th>性别</th>
  			<th>生日</th>
  			<th>操作</th>
  		</tr>
  		
  		
  		<c:forEach items="${stuList}" var="stu">
  			<tr>
	  			<td>${stu.id}</td>
	  			<td>${stu.name}</td>
	  			<td>${stu.sex ? "男" : "女"}</td>
	  			<td><fmt:formatDate value="${stu.bornDate}" pattern="yyyy年MM月dd日"/> </td>
	  			<td>
	  				<a href="student/update?id=${stu.id}" class="opr-btn">修改</a>
	  				<a href="student/delete?id=${stu.id}" onclick="return confirm('确定要删除此学员吗？');" class="opr-btn">删除</a>
	  			</td>
  		</tr>
  		</c:forEach>
  		
  	</table>
  </body>
</html>
